﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AlgorithmStarter
{
    [Serializable]
    public abstract class Message
    {
        public DateTime time;
    }

    /// <summary>
    /// message sent from monitoring sw to algorithm starter
    /// </summary>
    [Serializable]
    public class SetAlgorithm : Message
    {
        public string algorithmName;
        public object[] algorithmParams;
    }

    /// <summary>
    /// message from algorithm starter to monitoring: the ignore phase is starting
    /// </summary>
    [Serializable]
    public class IgnorePhase : Message
    {
        public IgnorePhase()
        {
            time = DateTime.Now;
        }
    }

    /// <summary>
    /// message from algorithm starter to monitoring: the run phase is starting
    /// </summary>
    [Serializable]
    public class RunPhase : Message
    {
        public RunPhase()
        {
            time = DateTime.Now;
        }
    }

    /// <summary>
    /// message from algorithm starter to monitoring: the run phase has ended
    /// </summary>
    [Serializable]
    public class RunPhaseCompleted : Message
    {
        public RunPhaseCompleted()
        {
            time = DateTime.Now;
        }
    }

    [Serializable]
    public class IgnorePhaseCompleted : Message
    {
        public IgnorePhaseCompleted()
        {
            time = DateTime.Now;
        }
    }

    /// <summary>
    /// message from algorithm starter to monitoring: the run phase has ended
    /// </summary>
    [Serializable]
    public class Error : Message
    {
        public string message;
        public Error(string message)
        {
            this.message = message;
            time = DateTime.Now;
        }
    }

    /// <summary>
    /// just a ping message
    /// </summary>
    [Serializable]
    public class Ping : Message
    {
    }

}
